from machine import ADC
import machine


power_vol = ADC(machine.Pin(10)) #电源
power_vol.atten(ADC.ATTN_0DB)

#获取电池宽电压
def get_ai_3_value():
    v3 = power_vol.read_uv()
    # print('v3',v3)
    value3="%.4f" %((v3/1000000)*40)
    print("current value of ai3:",value3)    
    return float(value3)

